question

annonnon-4680 avatar image
0 Votes"
annonnon-4680 asked annonnon-4680 commented

Automatically populate fields based on another choice field - SharePoint List

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.






office-sharepoint-onlinepower-query-not-supported
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AllenXu-MSFT avatar image
0 Votes"
AllenXu-MSFT answered annonnon-4680 commented

Hi @annonnon-4680 ,

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.


image.png (63.4 KiB)
image.png (116.5 KiB)
demo.gif (194.8 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Amazing! This worked great, thank you so much!

0 Votes 0 ·