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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Set variable to store ...
Power Apps
Unanswered

Set variable to store "created by" statement result

(0) ShareShare
ReportReport
Posted on by 57

Hi all,

 

Background info: based on the result of the variable value users can edit fields or not.

varLoggedinUser (this is set to the User() at OnStart

varRole (this is a lookup at Onstart

Status (this is a dropdown field if nothing is selected or if it is still Draft) 

 

                        

Currently I have the below formula in the DisplayMode option that I would like to simplify and store its result as a variable as it is very tiresome to apply this to specific fields especially when I need to combine it with additional criteria

 

 

 

 

 

If((SharePointIntegration.Selected.'Created By'.Email=varLoggedInUser.Email && (SharePointIntegration.Selected.Status.Value="Draft" || SharePointIntegration.Selected.Status.Value=Blank()) || varRole="Admin")

 

 

 

 

I tried to store this as a variable at OnStart but it just does not want to work:
Without the any additional criteria I tried to store it as varRequestor just to see if the user who opened the item is the creator:

 

 

 

 

If(SharePointIntegration.Selected.'Created By'.Email=User().Email,Set(varRequestor, true),Set(varRequestor,false))

 

 

 

This gives me totally inconsistent results.

Behavior:
1. User edits existing form – OnStart is triggered
2. User saves or cancels form
3. User opens new form - OnStart does not trigger – global variables are set to values from previous load
4. User saves or cancels form
5. User opens second existing item – OnStart does not trigger


Any suggestion how to check and store the created by in a variable?  How do you usually do it? Just to determine who is admin in a list is not enough (I am using that method as well to lock permanently down other fields)

 

 

Categories:
I have the same question (0)

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard