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 / Sharepoint list item g...
Power Apps
Unanswered

Sharepoint list item going blank (choice/text values)

(0) ShareShare
ReportReport
Posted on by 878

The Sharepoint list column is of Text type. 4 optiones, one of them being, "Another option", which makes visible a Textbox. The Data card is set to update to whatever was selected, except if "Another option" was selected, in this case it updates to what was written.

Code in Update of DataCard:
If(ComboBox1.Selected.Value = "Otra"; DataCardValue13.Text; ComboBox1.Selected.Value)

This code is what got me in other Sharepoint lists to retain whatever was selected in a similar scenario (sending combobox value to a Text column)

DefaultSelectedItems:
{'Forma de pago': Parent.Default}

Forma de pago is the Sharepoint Text column

But when I save, it only saves in the Sharepoint list, not the App. When you edit an item this will be blank. Well, the combobox will be blank. The Textbox will retain whatever was selected/written. I don't mind this happening for other cases other than "Another", as this will not be visible so, whatever. But I do need the selectedItem to be well...Selected.

Any ideas how to fix this?

Furthermore, in the Sharepoint list for some reason is saving with those bubbles that normally are for Choice columns, which makes this even more confusing...

DDD.PNG

 

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @WorkingRicardo - 

    As I understand it, you have a SharePoint List with a Single-Select Choice column. You say it is a Text type (a Single Line Text column), but there is nothing in your description which suggests it is.

     

    In SharePoint, you have configured the Choice field to contain four choices. One of these choices is "Another Option". You have also enabled "Allow 'Fill-'in' Choices for this column.

     

    In your app, you have an EditForm control. In this Form you have a DataCard which is associated to the Choice Field (called Forma de pago). This DataCard includes a Combo Box control.

     

    You have modified the DataCard and inserted a Text Input control inside it.

     

    If a user selects "Another Option" from the Combo Box control, this Text Input control becomes visible.

     

    On the Update property of the DataCard, if "Another Option" is selected, then the Form should save the output of the Text Input control into the choice field. If "Another Option" is not selected, then the Update property
    should save the value selected from the Combo Box control.

     

    Your question: you want to ensure the DefaultSelectedItems property in the Combo Box control returns whatever was entered for that record.

     

    Based on your scenario, I would have expected the DefaultSelectedItems property of the ComboBox control to only contain:

     

    Parent.Default

     

    And the Default property of the DataCard to only contain:

     

    ThisItem.'Your Choice Field'
  • WorkingRicardo Profile Picture
    878 on at

    Hello @Amik ty for your reply. Oh sorry if I didn't explain it correctly 😞 Still a newbie at this.

    But nope, the Sharepoint column is of Text type, but the actual dataCard associated to this column has a Combobox to select options, and only if you choose "Otra" (Spanish for Other), a textBox will appear where you can write:

    captura.PNG

    This shouldn't be part of the problem, as in other Sharepoint lists I've populated Comboboxes from Excel to then update a Text column. I did it this way, as I had trouble having a base Choice Sharepoint column in this enviroment.

    I didn't know about the Fill-in! Searched in the forum and found this code that, tweaked, I think changing to a Choice Sharepoint column and this could fix the situation:

    If(
     !IsBlank(YourComboBox.Selected),
     YourComboBox.Selected,
     !IsBlank(YourComboBox.SearchText),
     {
     Value: YourComboBox.SearchText
     }
    )

    It's not a perfect fit, as this only allow to Update when nothing is selected... Would like to keep the "Other" option and only in this scenario the written "Choice" is an option. Furthermore, whatever you write gets added as an option, which is another thing I do not want the choices should be fixed and only as a plus the possibility to add a written one, but this shouldn't be added to the possible list of choices in the ComboBox.

     

    Let me know if you know the fix for this Choice path. Or If my Text path is salvageable lol.

  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @WorkingRicardo - could you please click into the Items property of that ComboBox, and share the code it contains?

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#2
11manish Profile Picture

11manish 192

#3
Valantis Profile Picture

Valantis 128

Last 30 days Overall leaderboard