Hi Dear,
I have a small problem to final my custom form in Sharepoint.
What happens, When I want to edit a item in a sharepoint list my dropdown with the function distinct carry the first item automatically, but it isn´t showing the item on my list.
In powerapps studio My formula for the field 'Tipo Equipo' is: Distinct('Meter/Panel';Tipo).
The "Tipo" or "Tipo Equipo" has two types that it is: Panel and DIB6.
For the form new it works well but When I edit a registry it goes wrong.
Could you help my please
Solved! Go to Solution.
Hi @BrianS
I got to finish my problem, in Default of my dropdown I created a formula:
If (!IsBlank (ThisItem.'Tipo Equipo'); Parent.Default)
Now If exist a item in sharepoint it´ll bring the item and if not exist a item I´ll carry my formula distinct of the Item of the dropdown.
Thank a lot for your help.
Hi @Leandross89
The distinct function creates a one column table of unique values and renames the column "Result". You would use Result in any subsequent formulas that rely on the the value selected. So for example
If a Dropdown1 has an Items property of
Distinct(SPlist, columnname)
Then the items property of a gallery using that dropdown as a filter would be:
Filter(SPlist, columnname = Dropdown1.Selected.Result)
If I understand what is happening correctly you need to add an If statement in your Default property so that when the form is new it uses what you want for the default and if it is editing you use the value in the list. Something like
@Leandross89
An if statement isn't necessary. I prefer this syntax for simplicity in my apps as the Default property of the controls in the cards.
Coalesce(Parent.Default, SomeOtherValue)
The Parent Default is always blank in a New form so that function will return SomeOtherValue. When it is not blank, then it returns Parent.Default ref. https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-isblank-isempty
It's an uncommonly used PowerApps function but I like it!. Then again, some think my suggestions are weird.
I´m going try to explain with more detail What it´s happening with my form.
I´ve had created 3 form to customize my sharepoint list.
1- new
2 - edit
3- view
To create a registry it works well. so my new form is ok.
the only thing that lack to finish my customization is give to my dropdown the action distinct and show the item that is seing edited.
Why I use distinct? I have 2 list.
1 Fail Report (Main)
2 Meter/Panel (Where I search my item in dropdown)
Meter/Panel has multiple registries with diferents items like:
Serial Tipo
11100011 | DIB6 |
11100012 | DIB6 |
11100013 | Panel |
11100013 | DIB6 |
11100014 | DIB6 |
This dropdown needs something like distinct because there are multiples equals registry on the column.
When I click to edit a registry in Sharepoint, I want to show the item in the dropdown in my form edit and view, and if I want to change the item in my form edit it could show the option distinct item (Dib6 or Panel)
Example:
In edit form below the error is showing dib6 rather than Panel. my registry was record with panel not DIB6.
The formula in edit, new and view form is Distinct (MeterPanel, Tipo), it should be an error in edit and view form, because it works well in new form.
How I´ve said I need the option distinct at this dropdown because If use only the function filter it is going to show repeated items.
correct form: Edit and view form is showing the same item Panel registried in sharepoint.
And in Edit form I need to show the only two option (DIB6 and Panel) case someone to changes it.
I don´t know if exist other function to use rather than Distinct.
I´m sorry if I explain something wrong.
I think I understand. I would create a collection during start - something like:
ClearCollect(col_Tipo,Distinct(MeterPanel,Tipo))
Use that as the source for your dropdown. You can select "allowed values as a type when you create the cards in the form. That will give you the items to select from. Those should then be saved into your SP list.
If the problem is that what is selected is not being saved in the SP list, then I don't know if I have an answer for that.
Hi @BrianS
I got to finish my problem, in Default of my dropdown I created a formula:
If (!IsBlank (ThisItem.'Tipo Equipo'); Parent.Default)
Now If exist a item in sharepoint it´ll bring the item and if not exist a item I´ll carry my formula distinct of the Item of the dropdown.
Thank a lot for your help.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
195 | |
70 | |
51 | |
41 | |
30 |
User | Count |
---|---|
255 | |
120 | |
99 | |
92 | |
78 |