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 / How do i add autoscrol...
Power Apps
Answered

How do i add autoscroll in vertical gallery?

(0) ShareShare
ReportReport
Posted on by 403

I have a vertical gallery in power apps
I have A text input , a submit button
and 2 text labels

it looks like this

Jupyter123_0-1676281597342.png

 


SO whenever user types any question
and click submit button
the question will be sent to openai
and the response will be received

upto this it is working

but whenever user ask more question
the answer is also getting displayed
but it is not auto scrolling whenever the gallery gets full

my gallery name is questionsCollection
i have this code onselect property of submit button
Set(currentQuestion, TextInput1.Text);
Reset(TextInput1);
UpdateContext({flowResult: chatbot_powerapps_flow.Run(currentQuestion)});

If(!IsBlank(flowResult),
Collect(
questionsCollection,
{
Question: currentQuestion,
Answer: flowResult.text_ans,
Order: Max(questionsCollection, Order) + 1
}
)
)

and in first text label
i have ThisItem.Question
which is used to display question typed by user
second text label
ThisItem.Answer
which is used to display answer from openai api

now i want the gallery to be autoscroll automatically whenever new questions and answers are being added

Categories:
  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Jupyter123,

     

    If I understand it correctly, you would like to make the gallery automatically scroll to the bottom when a new question is added to the collection. In this case, this could be solved by setting the Gallery default property to Last(YourItemsPropertyFormulaHere).

     

    If your Items property of the gallery is only 'questionsCollection', your Default property of the gallery will look as follows:

    Last(questionsCollection)

    Each time a new question & answer is added, it scrolls down to the last record. (your new question)

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

  • Jupyter123 Profile Picture
    403 on at

    hi @LaurensM , thanks for the reply.
    my gallery item property is questionsCollection.
    So like u said my default property would be 

    Last(questionsCollection)

    After adding the above code to my gallery items property, what happens is
    it is just replacing the old question and answer with new one..

    Jupyter123_0-1676345433651.png

    if you see the above, it has question and an answer
    so if i type next question in textinput label it replaces old question and answer with new one..


     

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Jupyter123,

     

    We want the Gallery's items property to remain the same.

     

    The Gallery's Default property would be:

    Last(questionsCollection)

     

    The Gallery's Items property would be:

    questionsCollection

     

    All questions will be shown in the collection. However, the gallery will emphasize the last record, meaning that it will auto-scroll to the last record when a new record is added.

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 381 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard