web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to assign the Data...
Power Apps
Unanswered

How to assign the Datacard value in Power Apps from another Datacard value

(0) ShareShare
ReportReport
Posted on by 115

I have an application that allowing submission of a shoutout to more than 1 people with the following OnSelect action. Refer to the attached screenshot, the value of "Names" column (text column) for 2nd entry was not same as "User" column (people group column).  How to set the value of "Names" column same as "User" column?

 

ForAll(
DataCardValue2.SelectedItems,
Patch(
'ShoutOut',
Defaults('ShoutOut'),
{
'Reward Types': DataCardValue9.Selected,
Comments: DataCardValue3.Text,
Points: Value(DataCardValue1.Text),
User: ThisRecord,
Names: DataCardValue4.Text
}
)
);

Screenshot 2024-01-04 172343.png
Categories:
  • CU18061035-1 Profile Picture
    Microsoft Employee on at

    hey @jwhk 

     

    please try this:

    ForAll(
     DataCardValue2.SelectedItems,
     Patch(
     'ShoutOut',
     Defaults('ShoutOut'),
     {
     'Reward Types': DataCardValue9.Selected,
     Comments: DataCardValue3.Text,
     Points: Value(DataCardValue1.Text),
     User: ThisRecord,
     Names: ThisRecord.DisplayName
     }
     )
    );

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • jwhk Profile Picture
    115 on at

    Hi @mmbr1606 ,

     

    Thanks for your reply.

     

    Your answer gave the error message said "The type of this argument 'Names' does not match the expected type 'Text'. Found type 'Error'. This function 'Patch' has some invalid arguments."(refer to the attached screenshot).

     

    But I managed to resolve it by changing it to the following OnSelect action:

    ForAll(
    DataCardValue2.SelectedItems,
    Patch(
    'ShoutOut',
    Defaults('ShoutOut'),
    {
    'Reward Types': DataCardValue9.Selected,
    Comments: DataCardValue3.Text,
    Points: Value(DataCardValue1.Text),
    Names: ThisRecord.DisplayName,

    User: {
             Claims: "i:0#.f|membership|" & Lower(ThisRecord.Email),
             DisplayName: ThisRecord.DisplayName,
             Email: ThisRecord.Email,
             Department: ThisRecord.Department,
             JobTitle: ThisRecord.JobTitle,
             Picture: ThisRecord.Picture
             }
    }
    )
    );

    Screenshot 2024-01-05 083032.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard