movie ticket booking Seating Arrangement dynamically

Certified Senior Developer

How to create a movie ticket booking Seating Arrangement dynamically based on individual theater the seating for each and every theater is different. Admin can change the no.of seats how much he required.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    We can achieve it  using complex looping,  But for these type of use cases i don't suggest Appian SAIL.

  • 0
    Certified Senior Developer
    in reply to venkat Avuluri

    Hi

    Thanks for your reply, Without using appian SAIL, how can we achieve the requirement. Could you please suggest alternative solution.

  • 0
    Certified Lead Developer
    in reply to Shravani

    I don't think this is the right place to ask questions for non-appian related doubts. 
    And there should be some examples already on the web for this. If not, ChatGPT should help you. 

    And if you want to build this on Appian only for practice, then I think you can simply take up the total number of setas (assuming that there is not gaps or divisions) and then arrange them in a matrix. Here is my blog on how to do that - appianspace.com/.../

  • 0
    Certified Senior Developer
    in reply to Shravani

    Using other languages languages like  Java, JavaScript etc., You can manage back end processing for this use case in Appian. We can built the Interface but it's not gonna look good 

    If there is any other option Look into this thread it had a interface design , Use it and make necessary changes

  • 0
    Certified Senior Developer
    in reply to venkat Avuluri

    Hi,

    Yes I've gone through the code, they passed the no. of seats as statically(say 6 in every row in the above code),Now I need to pass the no. of seats dynamically based on the theater.

    Thanks

  • 0
    Certified Senior Developer
    in reply to Shravani

    a!localVariables(
      local!columns: 10,
      /*Pass it dynamically   */
      local!rows: 10,
      local!theaterSeating: 
        a!forEach(
          items: enumerate(local!rows) + 1,
          expression: a!localVariables(
            local!rowNumber: fv!index,
            a!forEach(
              items: enumerate(local!columns) + 1,
              expression: a!map(
                rownumber: local!rowNumber,
                columnnumber: fv!item,
                selected: false
              )
            )
          )
        )
      ,
      local!Seats:
      a!refreshVariable(
        value: a!flatten(local!theaterSeating),
        refreshOnVarChange: {local!theaterSeating}
      ),
      local!selectedSeats:a!refreshVariable(
     value:  index(local!Seats,wherecontains(true,toboolean(local!Seats.selected)),null),
     refreshOnVarChange: {local!Seats,local!theaterSeating}
      ),
      
      {
        a!cardLayout(
          contents: {
            a!forEach(
              items: local!theaterSeating,
              expression: a!sideBySideLayout(
                items: 
              a!forEach(
                items: fv!item,
                expression: a!sideBySideItem(
                  item: a!richTextDisplayField(
                    value:a!richTextIcon(
                      icon: if(fv!item.selected,"square-full",
                        "square-o"),
                        link: a!dynamicLink(
                          saveInto: {a!save(fv!item.selected,if(fv!item.selected=true,false,
                          true))
                          }
                        )
                    )
                  )
                )
              ))
            )
          }
        )
      }
    )

    Take a look at this code Shravani , I don't prefer it because if the rows are columns are too high, data on the interface ( in map) gonna be large so leads to performance issues (interface might gets slow), So go for alternatives. Or if you find any alternative within appian let us know

Reply
  • 0
    Certified Senior Developer
    in reply to Shravani

    a!localVariables(
      local!columns: 10,
      /*Pass it dynamically   */
      local!rows: 10,
      local!theaterSeating: 
        a!forEach(
          items: enumerate(local!rows) + 1,
          expression: a!localVariables(
            local!rowNumber: fv!index,
            a!forEach(
              items: enumerate(local!columns) + 1,
              expression: a!map(
                rownumber: local!rowNumber,
                columnnumber: fv!item,
                selected: false
              )
            )
          )
        )
      ,
      local!Seats:
      a!refreshVariable(
        value: a!flatten(local!theaterSeating),
        refreshOnVarChange: {local!theaterSeating}
      ),
      local!selectedSeats:a!refreshVariable(
     value:  index(local!Seats,wherecontains(true,toboolean(local!Seats.selected)),null),
     refreshOnVarChange: {local!Seats,local!theaterSeating}
      ),
      
      {
        a!cardLayout(
          contents: {
            a!forEach(
              items: local!theaterSeating,
              expression: a!sideBySideLayout(
                items: 
              a!forEach(
                items: fv!item,
                expression: a!sideBySideItem(
                  item: a!richTextDisplayField(
                    value:a!richTextIcon(
                      icon: if(fv!item.selected,"square-full",
                        "square-o"),
                        link: a!dynamicLink(
                          saveInto: {a!save(fv!item.selected,if(fv!item.selected=true,false,
                          true))
                          }
                        )
                    )
                  )
                )
              ))
            )
          }
        )
      }
    )

    Take a look at this code Shravani , I don't prefer it because if the rows are columns are too high, data on the interface ( in map) gonna be large so leads to performance issues (interface might gets slow), So go for alternatives. Or if you find any alternative within appian let us know

Children