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 set Global vari...
Power Apps
Answered

How to set Global varibales and write them into sharepoint column?

(0) ShareShare
ReportReport
Posted on by 201

Dear all:

Now i have a question, maybe it is small case for you, but it is hard for me to achieve it until now.

My porposal is that i need to set four Global variables for my app and write them in sharepoint list four columns dynamically. I need to run sequence approval from this app.

They are ApproverEmail(Single line of TEXT)、ApprovalLevel(Number)、ApprovalLog(multi line of text)、ApprovalStatus(Single line of TEXT) 

ApproverEmail is used to record Approver's Email address by lookup function from anotherlist(You have solved this case for me), i need to store it into a variable and write it into column and change it time to time.

ApprovalStatus is used to record Approval status, for example ,Submitted\Approving\Approved\Rejected, i need to store it into a variable and write it into column and change it time to time by different status of approval.

ApprovalLevel is used to record Approval Level, the initial value is 1, if the first person have appproved, ApprovalLevel need to calculate automatically ApprovalLevel = ApprovalLevel+1, .........i need to store it into a variable and write it into column and change it time to time

ApprovalLog is used to record Approver's comments during approval. i need to record his name automatically when he give comments and approver can view previous approver's comments. .i need to store it into a variable and write it into column and change it time to time

Jackywei_BDF_0-1652087774448.png

 

I added a button named as "Approve", when i click this button, it will  write his comments into ApprovalLog with his name and set ApprovalLevel = ApprovalLevel+1 , then send email to next approver automatically.

Jackywei_BDF_1-1652087775056.png

 

 

I don't know how to set variables in apps and set them into onchange property.

Jackywei_BDF_2-1652087774584.png

 

 

Would you please help me for these cases?

 

Thanks for your support:)

Categories:
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Jackywei_BDF ,

     

    Onchange will be triggered when the value has changed in the control.

    So you could use  Set(your variable, DataCardValue...)  on the onchange property to create/update your global variable.

     

    Then you could set the global on the update property of your datacard .If you submit the form , it will write them to sharepoint.

     

    Best Regards,

    Wearsky

  • Jackywei_BDF Profile Picture
    201 on at

    Hi @v-xiaochen-msft :

     

    I did it by your said, unfortunately, it didn't work.

    Please take a look as below screenshots.

    Global Variable=Level

    Jackywei_BDF_0-1652344442482.png

    Jackywei_BDF_1-1652344503346.png

    Would you please help me out?

     

    Thank you very much!

     

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Jackywei_BDF ,

     

    What's the 'DataCardValue47'?

    If it's a DropDown or Combo box control, you need to use DataCardValue47.Selected....

    Add a '.' after the control, the formula will intelligently display the properties of the control.

     

    Best Regards,

    Wearsky

     

  • Verified answer
    Jackywei_BDF Profile Picture
    201 on at

    Hi @v-xiaochen-msft 

     

    Thanks for your reminder.

    Now it is no error after i change it as Set(Level, Value(DataCardValue47.Text))

    Jackywei_BDF_0-1652348469036.png

     

    Jackywei_BDF_1-1652348614578.png

     

     

    I will test it in apps.

     

    Thanks for your support:)

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 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard