cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Patch to different datasource depending on a variable

Hi,

I would like the information collected by my app to be written to a specific datasource depending on which user is logged in.

Currently, I am using:

'If(User().Email = "...",Patch(...' etc.

but with over 20 distinct users this is not ideal.

 

I have tried unsucessfully to Set a dynamically named  variable by Concatenating and then:

Patch(variablename,

or

Patch(Text(variablename),

etc.

Any help with Patching to dynamic datasources would be appreciated.

Thanks,

David

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Anonymous ,

 You cannot refer dynamically to a data source, control or field in Power Apps, so you will have to hard-code it.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @Anonymous ,

 You cannot refer dynamically to a data source, control or field in Power Apps, so you will have to hard-code it.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Anonymous
Not applicable

That's a pity. Thanks for the reply.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,432)