cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
shabilass
Helper II
Helper II

Update column name that have same name as User().Email

Dear all,

 

In PowerApps, I have a gallery with textbox input. User need to insert marks for each gallery items and submit. The data source is SharePoint list.

g1.PNG

 

My SharePoint list have several columns as below image (in this case, I used Excel to explain):

SPL.PNG

 

I'm not sure I'm making this correct or not. The issue here is, after user submit the gallery in PowerApps, I want the app capture User().Email and update column in which column name is matched with User().Email. Column name (sarah@abc.com.my and etc.) is Number type.

 

I tried to do something like this, but not yet get the logic how I can find column name that matched User().Email to update the marks for all items gallery.

Submit Button: OnSelect:

ForAll(Gallery1.AllItems,
Patch('List Name', Defaults('List Name'), {Title: Label1.Text, 'sarah@abc.com.my': Value(TextInput1.Text)})

 

Any suggestion to solve this?

 

Thank you in advanced!

 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @shabilass ,

You cannot dynamically refer to a field name in Power Apps - unless you hard-code the column for each user as a separate Patch option, there is no real way of achieving what you need.

 

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

4 REPLIES 4
VijayTailor
Resident Rockstar
Resident Rockstar

HI @shabilass ,

as per my understanding , you are trying to update the Marks.

but i can see you are using the Default command with Forall function.

Basically, if you create a new record then you can use the default COmmand but for the Update, you need to pass the Record value, for Update.

ForAll(Gallery1.AllItems,
Patch('List Name', ThisRecord, {Title: Label1.Text, 'sarah@abc.com.my': Value(TextInput1.Text)})

try This.
Hope this will help you to resolve your issue.

Thanks,
vijay

Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."-Vijay





Hi @VijayTailor 

 

Yes I'm trying to update the marks, but I want the marks is updated for one column only for all items list for upon submission.

 

Which mean every submission, the system capture User().Email and find any match column name (sarah@abc.com.my or hannah@abc.com.my or harry@abc.com.my).

 

If let say current User().Email is sarah@abc.com.my, it will only update marks for sarah@abc.com.my column only not for other columns.

WarrenBelz
Super User
Super User

Hi @shabilass ,

You cannot dynamically refer to a field name in Power Apps - unless you hard-code the column for each user as a separate Patch option, there is no real way of achieving what you need.

 

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

Hi @shabilass ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,937)