web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Change text box value ...
Power Apps
Answered

Change text box value in Repeating Table

(0) ShareShare
ReportReport
Posted on by

Is there a way to change text box value without using variable?  I created a repeating table by watching this YouTube video.  It works great and something I want to use on my app. But rather than using textboxes to input the email address and job title, I was wondering if I could use a combo box, search for the person's name, and populate the two text boxes?

---Edited---

The Gallery has 3 fields/columns:

  • Combo Box with Item property set to 
    Office365Users.SearchUser({searchTerm:ComboBox5.SearchText})
  • The other two fields have default property as LineName and LineTitle respectively. 
  • Each row has a plus icon with onSelect property:
    Patch(ReviewerCollection, ThisItem, {LineName: TextInput4.Text, LineTitle: TextInput5.Text}); Collect(ReviewerCollection, {LineName: "", LineTitle: ""})

What I want to accomplish is that each time the ComboBox5 is changed, I want to populate the current item's LineName and LineTitle with ComboBox5.Selected.Mail and ComboBox5.Selected.JobTitle


I tried below on OnChange property of ComboBox5, it does not give any error but it doesnt do anything as well. Somehow I think I need ThisItem somwhere but none of my attempts worked.

UpdateContext({LineName:ComboBox5.Selected.Mail}) 

 

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @Tamras 

    All comboboxes and dropdown controls may show only one column in the window but they hold the entire record.  You can reference them directly in the Text property of a label or in the default property of a Textinput box.  In your case, 

    ComboBox5.Selected.JobTitle

    will display the JobTitle for the record selected in the combobox if it is used in a TextInput control without resorting to a variable. 

  • Aethyta Profile Picture
    on at

    @Drrickryp I already your solution but I'm using it on a repeating table. So the formula just repeats the same value each time I add a new row.  Each row has an add button with the following formula

    Patch(ReviewerCollection, ThisItem, {LineName: TextInput4.Text, LineTitle: TextInput5.Text}); Collect(ReviewerCollection, {LineName: "", LineTitle: ""})

    I have to keep the default values to LineName and LineTitle. I edited my question, I initially missed a step but corrected it now. 

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    I haven't developed an app with an infopath like repeating gallery and maybe I don't understand the problem, but if the Dropdown box is inside of the Gallery, you can just set the TextInputBox defaults as I described.  Capture.PNG

  • Aethyta Profile Picture
    on at

    @Drrickryp I'm obviously doing something wrong because in my gallery, each time I insert a new row, it just populates the 2 columns with whatever value I had on the first row.  The data in the collection is correct though.

    I followed the steps in the video. 

    On Screen1, I have a button with OnSelect property:

    NewForm(Form1); ClearCollect(ReviewerCollection, {LineName: "", LineTitle: ""}); Navigate(Screen2, ScreenTransition.Cover)

    On Screen2, I added a gallery with a comboBox5, inputName, inputTitle columns, and a plus icon. 

    • inputName default is comboBox5.Selected.Mail
    • inputTitle default is comboBox5.Selected.JobTitle
    • comboBox5 Items is Office365Users.SearchUser({searchTerm:ComboBox5.SearchText})
    • icon OnSelect is Patch(ReviewerCollection, ThisItem, {LineName: inputName.Text, LineTitle: inputTitle.Text}); Collect(ReviewerCollection, {LineName: "", LineTitle: ""})

    On Row 1 of the gallery, I select someone from comboBox5 and it populates the 2 input boxes accordingly .  When I click the plus icon, it inserts a new row with the same data as the first row.  I select a new name on row 2 and it changes the input boxes accordingly. But when I click the plus sign again, it changes the values to the value on row 1.  The data in the collection is correct but not the data being displayed on the gallery.  

  • Verified answer
    Aethyta Profile Picture
    on at

    Finally solved this. Not sure if its the best practice though.  On my comboBox5 onChange property, I have the following formula:

    Patch(ReviewerCollection, ThisItem, {LineName: ComboBox11.Selected.Mail, LineTitle: ComboBox11.Selected.JobTitle})

    and on my plus icon:

    Collect(ReviewerCollection, {LineName: "", LineTitle: ""})


    Thanks @Drrickryp 

  • AlexIbVar Profile Picture
    2 on at

    Hello @Tamras , 

     

    for this part:

    Collect(ReviewerCollection, {LineName: "", LineTitle: ""})

     Did you update the inputName, inputTitle columns? changing the Default from "ThisItem.LineName" to "comboBox5.Selected.Mail" would give you an error... at least it does for me:

    AlexIbVar_0-1708538023557.png

     

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard