Automatically populate fields based on another choice field - SharePoint List

annonnon 101 Reputation points
2021-10-28T03:38:58.677+00:00

Hi,

I apologize this may be the wrong forum to ask this, but I am unable to register into PowerApps Community and need to find answers to how this might be possible:

Similar to this post (https://powerusers.microsoft.com/t5/Building-Power-Apps/Automatically-populate-choice-field-based-on-another-choice/m-p/812649#M259101), I have a list in SharePoint that has, among other columns, one choice column and other text columns:

Column A (choice)

Option 1

Option 2

Option 3

Option 4

Option 5

Column B "Start Time"

(single line text)

Column C "End Time"

(single line text)

If the user selects Option 1, I'd like Column B and Column C (ie. start and end times) to auto-fill, and same for all other options with different Column B&C times.

Eg.
If in Column A we select Option 1, we want the times to be auto filled:
Column B - 00:01
Column C - 06:00

If in Column A we select Option 2, we want the times to be auto filled:
Column B - 06:00
Column C - 16:00

and so on.

Would greatly appreciate any assistance. Thank you.

Microsoft 365 and Office SharePoint For business Windows
Community Center Not monitored
0 comments No comments
{count} votes

Accepted answer
  1. Allen Xu_MSFT 13,861 Reputation points
    2021-10-28T07:44:01.663+00:00

    Hi @annonnon ,

    As an example, in my case the value of the choice field is called DataCardValue2 in the form.
    144475-image.png

    I applied below formula to the Default property of "Start Time" field:

    If(DataCardValue2.Selected.Value="Choice 1", "00:00", (If(DataCardValue2.Selected.Value="Choice 2", "06:00", (If(DataCardValue2.Selected.Value="Choice 3", "08:00", If(DataCardValue2.Selected.Value="Choice 4", "10:00", If(DataCardValue2.Selected.Value="Choice 5", "12:00", Parent.Default)))))))  
    

    144426-image.png

    Take a look at the result:
    144482-demo.gif

    You can refer to my steps and formula.

    ----------

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.