cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Gaëlle
Level 8

PowerApps & SharePoint : retrieve value from a Column conditionnally

Hi there !

 

I think I'm missing something in PowerApps :

I've made a custom Form, whith some fields being based on MyCustomList01.

This form, once submitted (well, "Patched", really), is recording an Item in MyCustomList02.

 

Anyway, I am trying to get a field to behave particularly :

I am trying to display the Store where the currentUser is working.

 

For that, in MyCustomList01, I have three different email columns (which are Single lines of text) ; Email1, Email2 and Email3, and the StoreName column (also a single line of text)

 

For the moment, I am able to say if my currentuser email is in the list with :

If(Or(User().Email in Distinct('MyCustomList01';Email1);User().Email in Distinct('MyCustomList01';Email2);User().Email in Distinct('MyCustomList01';Email3));"Email is In";"Email is not In")

But i don't know how to retrieve the storename. I want to display it in a TextField, so that should be "easy", but I can't figure out how to retrieve the StoreName.

 

so, Do you know how to retrieve the value of a column conditionnally ? knowing that i don't have any BrowseGallery or things like that...

 

Thanks a lot by advance Smiley Happy

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Gaëlle
Level 8

Re: PowerApps & SharePoint : retrieve value from a Column conditionnally

Hi @v-xida-msft,

Thanks for your time, but I found the solution by myself :

 

MyCustomList01 is made like that :each of my columns is a single line of text :

StoreName,StoreNumber,Email1,Email2,Email3,CashflowEmail,etc..

And there is Network, which is a Choice column.

 

Now, in MyCustomList02, we have only single lines of text

Network (which is column Title renamed), StoreNumberAndName, Service, Question and Attachment

 

In my PowerApps form,

- i wrote this formula in Datas > Default for my MyCustomList02 's Network column :

LookUp('MyCustomList01';Or(Email1=User().Email; Email2=User().Email; Email3=User().Email);Reseau)

It is a lookup to get the text value of the dropdown.

 

- For the StoreNumberAndName, I've wrote this one :

LookUp('MyCustomList01';Or(Email1=User().Email; Email2=User().Email; Email3=User().Email);Concatenate(NumMagasin;" - ";Title))

So my Lookup goes searching for my column value where my User().Email is either in Email1,2 or 3, in MyCustomList01

 

Everything is working fine now Smiley Happy

 

Thanks a lot for your time !

 

Have a nice day

 

2 REPLIES 2
Community Support Team
Community Support Team

Re: PowerApps & SharePoint : retrieve value from a Column conditionnally

Hi @Gaëlle,

 

Could you please share a bit more about your MyCustomList01 SP list?

Do you want to display the StoreName when the current user email is in the Email1 column, Email2 column or Email3 column?

Further, how many stores does a user work on?

 

If a user (current user) is working for a single one Store, I have made a test on my side, please take a try with the following workaround:

 

  • Set the OnVisible property of the screen to following formula:

 

UpdateContext({
DisplayStoreName:First(RemoveIf(ForAll('20180626_case10',If(Or(User().Email=Email1,User().Email=Email2,User().Email=Email3),StoreName,Blank())),Value=Blank())).Value
})

 

  • Add a Label control within screen, set the Text property to following formula:

 

DisplayStoreName

 

Note: The '20180626_case10' represents the SP list data source within my app, the Email1, Email2, Email3 and StoreName are all columns in my SP list.

 

 

If a user (current user) is working for multiple Stores, I have made a test on my side, please take a try with the following workaround:

 

  • Set the OnVisible property of the screen to following formula:
UpdateContext({
DisplayStoreName:Concat(RemoveIf(ForAll('20180626_case10',If(Or(User().Email=Email1,User().Email=Email2,User().Email=Email3),StoreName,Blank())),Value=Blank()),Value&" & ")
})
  • Add a Label control within screen, set the Text property to following formula:
DisplayStoreName

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Gaëlle
Level 8

Re: PowerApps & SharePoint : retrieve value from a Column conditionnally

Hi @v-xida-msft,

Thanks for your time, but I found the solution by myself :

 

MyCustomList01 is made like that :each of my columns is a single line of text :

StoreName,StoreNumber,Email1,Email2,Email3,CashflowEmail,etc..

And there is Network, which is a Choice column.

 

Now, in MyCustomList02, we have only single lines of text

Network (which is column Title renamed), StoreNumberAndName, Service, Question and Attachment

 

In my PowerApps form,

- i wrote this formula in Datas > Default for my MyCustomList02 's Network column :

LookUp('MyCustomList01';Or(Email1=User().Email; Email2=User().Email; Email3=User().Email);Reseau)

It is a lookup to get the text value of the dropdown.

 

- For the StoreNumberAndName, I've wrote this one :

LookUp('MyCustomList01';Or(Email1=User().Email; Email2=User().Email; Email3=User().Email);Concatenate(NumMagasin;" - ";Title))

So my Lookup goes searching for my column value where my User().Email is either in Email1,2 or 3, in MyCustomList01

 

Everything is working fine now Smiley Happy

 

Thanks a lot for your time !

 

Have a nice day