cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KarolCzer
Helper I
Helper I

Change DataCardValue if one (and only) DisplayName appears

Hi PowerApps Users,

 

My case: I have a SharePoint list, based on my list I'm creating a PowerApp to display Suggestions for our company, where I included a PowerAutomate Flow which is updating "Created by" column to our service account, which has DisplayName in O365 "Process Automation", if someone wants to send that suggestion anonymously.

 

 

KarolCzer_0-1653426320893.png

 

I would like to make a change like this:

If suggestion "Created By is "Process Automation", change the text in DataCardValue1_1 to "Anonymous"".
Else - go Parent.Default

 

1 ACCEPTED SOLUTION

Accepted Solutions
EddieE
Super User
Super User

@KarolCzer 

'Created By' is a system generated table of records and you cannot change this, however, you could hide the DataCard and show a label if the text is "Process Automated". Something like this

 

// place this code on the Visible property of the DataCard
!(First(Self.SelectedItems).DisplayName = "Process Automation")

 

Then, add a label to this data card, place it directly over the top of the above DataCard (you may need to remove the above code to get it in the right location) then add this code to the Label

// Text property
"Anonymous"

// Visible property
(First(DataCardValue47.SelectedItems).DisplayName = "Process Automation")

 

Note: I've assumed that you just want a visual effect here which is for the users of your app and not looking to change the data in your source data. I don't even know if you can change any system generated data ( eg Created by, Created, Modified by, etc) although you maybe able to do this via Flow / Power Automate?

View solution in original post

2 REPLIES 2
EddieE
Super User
Super User

@KarolCzer 

'Created By' is a system generated table of records and you cannot change this, however, you could hide the DataCard and show a label if the text is "Process Automated". Something like this

 

// place this code on the Visible property of the DataCard
!(First(Self.SelectedItems).DisplayName = "Process Automation")

 

Then, add a label to this data card, place it directly over the top of the above DataCard (you may need to remove the above code to get it in the right location) then add this code to the Label

// Text property
"Anonymous"

// Visible property
(First(DataCardValue47.SelectedItems).DisplayName = "Process Automation")

 

Note: I've assumed that you just want a visual effect here which is for the users of your app and not looking to change the data in your source data. I don't even know if you can change any system generated data ( eg Created by, Created, Modified by, etc) although you maybe able to do this via Flow / Power Automate?

Hi @EddieE,

 

It worked, thanks!

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (2,453)