Autoselect value in dropdown if only one value present

classic Classic list List threaded Threaded
25 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Autoselect value in dropdown if only one value present

mbojja
The dropdown result must be

111 - Director - BU


On Friday, November 15, 2019 at 8:34:08 AM UTC+8, MANISH wrote:
Hi Alex - This is the snippet of the JSON

{
"success":true,
"message":null,
"staff":
{"eid":"1234",
"firstName":"John",
"lastName":"Blokes",
"positions":
[{"description":"Director - BU",
"Id":"111"},
{"description":"null - Other Services",
"Id":"222"},
{"description":"Director",
"Id":"111"},
{"description":"null- Commercial",
"Id":"333"}]
}
}

On trigger, the dropdown must have the values as "Id - description". I need all the distinct values of description not containing 'null'. Date should be same as dropdown label.

Thanks
Manish

On Friday, November 15, 2019 at 8:11:30 AM UTC+8, Alessandro Vernet wrote:
Hi Manish,

Could you attach the actual JSON returned by your service? You're saying
that you'd like to have "111 - Brazil", "100 - America", etc shown in the
dropdown. And what would you like to be stored in the data? The same thing?

I'm asking all those details, so I can just create, test, and share with you
an example that does this.

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: <a href="http://discuss.orbeon.com/" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;">http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/650be9e4-2756-4385-bbf5-bf33625a49b1%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Autoselect value in dropdown if only one value present

Alessandro  Vernet
Administrator
In reply to this post by mbojja
Hi Manish,

Would the following work?

Choices: `/json/staff/positions/_[not(starts-with(description,
'null'))]/concat(Id, ' - ', description)`
Label: `.`
Value: `.`

With the above JSON, this will give you:

111 - Director - BU
111 - Director

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1573865576750-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Autoselect value in dropdown if only one value present

Alessandro  Vernet
Administrator
Hi Manish,

Did you get a chance to try the XPath expressions in my previous message to
populate the dropdown from the result of your service? If so, is it indeed
inline with what you were looking for?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1574443846546-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Autoselect value in dropdown if only one value present

mbojja
Thanks Alex - it works perfect!!

On Saturday, November 23, 2019 at 1:27:03 AM UTC+8, Alessandro Vernet wrote:
Hi Manish,

Did you get a chance to try the XPath expressions in my previous message to
populate the dropdown from the result of your service? If so, is it indeed
inline with what you were looking for?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: <a href="http://discuss.orbeon.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;">http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/f2b03139-ee06-44ae-9e52-72432f6fe992%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Autoselect value in dropdown if only one value present

Alessandro  Vernet
Administrator
Perfect Manish, and thank you for the confirmation!

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1574702441860-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
12