cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rene1997
Regular Visitor

Saving variables

Hey!

 

I just created something like an inventory list and therefore i need to safe variables.

As you can see in the picture below, every object does have a variable "Aktueller Besitzer", which means current owner, and a variable "Vorbesitzer", which means previous owner.

 

As soon as i save my changes i want that the current owner automatically gets the previous owner. 

Therefor i need to safe the name behind current owner to replace the previous owner with it.

 

Thanks for your help!

 

Yours

Rene

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @Rene1997 ,

 

According to your description, I've made a test for your reference:

 

1\ This is my list ‘LIST82’. ‘multimeter’ is a single line of text column. ‘previous owner’ and ‘current owner’ are person columns.

v-xiaochen-msft_0-1614309788419.png

 

 

2\ Add a gallery control ‘Gallery2’ in Screen2 and set its Items property to:

LIST82

 

Set ‘Gallery2’ ‘s onselect property to:

Set(Thevar,ThisItem);Navigate(Screen3)

 

3\ Add an edit form control ‘Form1’ in Screen3 and set its DataSource property to:

LIST82

 

Set ‘Form1’ ‘s Item property to:

Gallery2.Selected

 

Set ‘Form1’ ‘s Fields property like picture:

v-xiaochen-msft_1-1614309788422.png

 

 

Set previous owner ‘s control’s DisplayMode property to:

DisplayMode.Disabled

v-xiaochen-msft_2-1614309788426.png

 

 

4\ Add a submit icon and set its onselect property to:

Patch(LIST82,Thevar,{'previous owner':Thevar.'current owner',Title:DataCardValue1.Text,multimeter:DataCardValue2.Text,'current owner':DataCardValue3.Selected})

// DataCardValue1 and DataCardValue2 are textinput control in ‘Form1’. DataCardValue3 is a combo box control in ‘Form1’.

 

5\ The result is as follows:

v-xiaochen-msft_3-1614309788427.png

 

v-xiaochen-msft_4-1614309788428.png

 

v-xiaochen-msft_5-1614309788430.png

 

v-xiaochen-msft_6-1614309788430.png

 

 

In this solution, I used the patch() function to submit data instead of the submitform() function.

Since this is a broad question, this is only a reference example, you need to make some modifications according to your own data and controls.

 

Best Regards,

Wearsky

If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

6 REPLIES 6
v-xiaochen-msft
Community Support
Community Support

Hi @Rene1997 ,

 

Could you tell me:

  1. What is the structure of your list?
  2. What's data type of 'Aktueller Besitzer' column? Is it a choice columnn?
  3. What's data type of 'Vorbesitzer' column?

 

Sorry i am confused about your needs.

Could you tell me your needs in the form of pictures?

For example, the picture before the data is modified./ the picture after modifying the data (the result you need).

 

Best Regards,
Wearsky

Rene1997
Regular Visitor

Hey @v-xiaochen-msft 

 

Thanks for your reply.

1. I created the list on MS Teams via "Lists" and then i created an app with Power Apps. Or what do you mean with the structure of my list?

2. Yes, 'Aktueller Benutzer' and 'Vorbesitzer' are choice columns

 

How can i find out the data type? 

I'd say its a string?

 

Sorry im new to power apps..

 

Thanks!

v-xiaochen-msft
Community Support
Community Support

Hi @Rene1997 ,

 

Could you tell me:

What's your data source? Is it sharepoint list or CDS(Dataverse)?

Just want to confirm, have you created a canvas app in teams?

 

Firstly, I hope you provide the column name of your data source and its data type.

For example:This is my list . 'TestPerson' column 's data type is Person.

v-xiaochen-msft_0-1614242856156.png

 

Secondly , please elaborate on your needs. Sorry I am very confused about the requirement you mentioned at the beginning.You could use pictures and text to express your needs. Thanks.

 

Best Regards,

Wearsky

 

 

 

Hey @v-xiaochen-msft 

 

My data source is a sharepoint list.

Ah - now i know what you mean. The data type of of both, so current owner and previous owner, is Person.

 

I'll try again to explain what i want to do:

 

If someone wants to use an object, like a multimeter in this case, they should press the arrow and change the status of the multimeter so everyone knows they have it.

 

Screenshot_15.png

 

In the following form you should enter the date when the object is used and who owns it now.

If something is missing or damaged, I want to know who was the previous owner.

To know this, I need to make the current owner the previous owner.
And that is before he enters himself as the current user.

Screenshot_16.png

So I have to save the current user and replace the previous owner with it.

 

Yours,

Rene

v-xiaochen-msft
Community Support
Community Support

Hi @Rene1997 ,

 

According to your description, I've made a test for your reference:

 

1\ This is my list ‘LIST82’. ‘multimeter’ is a single line of text column. ‘previous owner’ and ‘current owner’ are person columns.

v-xiaochen-msft_0-1614309788419.png

 

 

2\ Add a gallery control ‘Gallery2’ in Screen2 and set its Items property to:

LIST82

 

Set ‘Gallery2’ ‘s onselect property to:

Set(Thevar,ThisItem);Navigate(Screen3)

 

3\ Add an edit form control ‘Form1’ in Screen3 and set its DataSource property to:

LIST82

 

Set ‘Form1’ ‘s Item property to:

Gallery2.Selected

 

Set ‘Form1’ ‘s Fields property like picture:

v-xiaochen-msft_1-1614309788422.png

 

 

Set previous owner ‘s control’s DisplayMode property to:

DisplayMode.Disabled

v-xiaochen-msft_2-1614309788426.png

 

 

4\ Add a submit icon and set its onselect property to:

Patch(LIST82,Thevar,{'previous owner':Thevar.'current owner',Title:DataCardValue1.Text,multimeter:DataCardValue2.Text,'current owner':DataCardValue3.Selected})

// DataCardValue1 and DataCardValue2 are textinput control in ‘Form1’. DataCardValue3 is a combo box control in ‘Form1’.

 

5\ The result is as follows:

v-xiaochen-msft_3-1614309788427.png

 

v-xiaochen-msft_4-1614309788428.png

 

v-xiaochen-msft_5-1614309788430.png

 

v-xiaochen-msft_6-1614309788430.png

 

 

In this solution, I used the patch() function to submit data instead of the submitform() function.

Since this is a broad question, this is only a reference example, you need to make some modifications according to your own data and controls.

 

Best Regards,

Wearsky

If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

Thanks @v-xiaochen-msft 

 

This helped me a lot!

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 (1,384)