I have created a sharepoint list and a dropdown list with 4 values. I would like to set one of those as the default value on the dropdown list. How can I achieve this ?
Solved! Go to Solution.
Hi @iioannou,
Could you please share more details about the error message within your app?
Do you create a SharePoint custom form using PowerApps on your side?
I have made a test on my side and don't have the issue that you mentioned. The screenshot as below:
Unlock the Data Card control which contains the Combo box control, then set the Default property of the Combo box control to following formula:
If(SharePointForm1.Mode=FormMode.New, {'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference", Id: 0, Value: "Pending" }, ThisItem.Status
)
I found that there is something wrong with the formula that you provided within the Default property of the Combo box control, please modify your formula as below:
If(SharePointForm1.Mode=FormMode.New, {'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference", Id: 0, Value: "Pending" }, ThisItem.Status
)
Note: Change the ThisItem.Category within your formula into ThisItem.Status.
Best regards,
Kris
Hi @iioannou,
One more thing, due to my country (CZ) I have to use ; instead of , and ;; instead of ;. So it is possible that you have to replace ; by ,.
P.
Hi @iioannou,
You have to write in Default column text from SharePoint list that is being displayed as Value for your dropdown.
For example I have list - EmailList with two items and other columns and I display Title, where I have Petr as second item so I wrote "Petr" as Default.
Hope this help.
P.
I tried it but this is what I get...
Hi, @iioannou
You are setting it for whole datacard you have to set it just for dropdown that is part of datacard....
You have to open it and select only dropdown item.
I found a thread that is already trying to achieve you are looking for and it seems like there is solution provided.
P.
I tried both what you suggested and what was on the link. nothing worked 😕
What do you use as source of data for your PowerApps? If it is SharePoint list, are those choices as choice column in SharePoint or not?
P.
Yes I am using sharepoint list and those are my choices
Pending
In Progress
Processed
Needs Review
I want to simply set up as default the Pending
Soso I'm also using SharePoint list in my demo for Category.
Here I have two choices
LAPTOP / PC HW problém
LAPTOP / PC SW problém
And in my PowerApp I replaced for Category datacard in form named "CreateTicketForm" the Default Option to this
If(CreateTicketForm.Mode = New;{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"; Id:1; Value:"LAPTOP / PC SW problém"};ThisItem.Category)
Previously there was only "ThisItem.Category" and the If is updating it to - If there is a Form named "CreateTicketForm" opened in mode New then use as default second item in choice column. In your case in should look like:
If(<NameOfYourForm>.Mode = New;{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"; Id:0; Value:"Pending"};ThisItem.Category)
PrintScreen
P.
Thank you - I did as per your guidance but I still have an error.. please see the screenshot
User | Count |
---|---|
224 | |
100 | |
95 | |
57 | |
31 |
User | Count |
---|---|
283 | |
114 | |
110 | |
63 | |
57 |