Skip to main content
September 29, 2021
Question

how can i transfer property 'user' of type Text into type List of Variant

  • September 29, 2021
  • 20 replies
  • 0 views

if(isnull(or(ri!a,ri!b)),{},a!forEach(
  items:rule!KONE_Development_CSE_TENDER_PHASES_Search_Rule(ri!a),
  expression:a!localVariables(
    local!csetenderphases:fv!item,
    a!forEach(
      items:rule!KONE_Development_CSE_TENDER_Search_Rule(local!csetenderphases.tenderId),
      expression:
      if(local!csetenderphases.tenderId=fv!item.id,
      if(or(fv!item.statusId="3",fv!item.statusId="4"),{},{
        a!update(data:local!csetenderphases,index:"user",value:ri!b)
      })
      ,{})
    )
  )
).list.user
)

As title, i need transfer all value to be correct form to be saved

thank you all

    20 replies

    September 29, 2021

    how may i transfer it to data?

    stefanhelzle0001
    Brainy
    September 29, 2021

    What do you actually want to achieve?

    What did you try? What was the outcome? What is wrong with it?

    The community is not able to help without more details. I try to convince you of this in almost all my replies.

    September 29, 2021

    hey sir, how are you today, hope you have a nice day.

    The top code is the list i extract from want to save into database put into the value:   and in the rule it return with:

    However, it always report cannot index {'id',"name",...etc} into list of variant, I doubt I couldn't transfer each of columns into the correct data forms put into value:. How can I transfer? I want to save all list of those value return save into database by using a!writeintodatastoreentity.

    stefanhelzle0001
    Brainy
    September 29, 2021

    I can see that you trapped into a typical problem using foreach. The issue here is that you have nested lists. Give a!flatten() a try.