how many instances of r are there in:
q: chat embedded_svc.settings.fallbackrouting not working i am trying to implement a fallback routing mechanism for my chat implementation with skills routing.
i am putting my chat snippet in a visualforce page:
<apex:page showheader=false sidebar=false standardstylesheets=false>

    <style type=text/css>
        .embeddedservicehelpbutton .helpbutton .uibutton {
            background-color: #005290;
            font-family: arial, sans-serif;
        }
        .embeddedservicehelpbutton .helpbutton .uibutton:focus {
            outline: 1px solid #005290;
        }
    </style> 

    <script type=text/javascript src=https://service.force.com/embeddedservice/5.0/esw.min.js></script>
    <script type=text/javascript>
        var initesw = function(gslbbaseurl) {
            embedded_svc.settings.displayhelpbutton = true; //or false
            embedded_svc.settings.language = ; //for example, enter en or en-us


            embedded_svc.settings.fallbackrouting = [buttonid1,buttonid2]; //an array of button ids, user ids, or userid_buttonid


            embedded_svc.settings.enabledfeatures = [liveagent];
            embedded_svc.settings.entryfeature = liveagent;

            embedded_svc.init(
                my sub-domain url,
                my community url,
                gslbbaseurl,
                my org id,
                skills_chat_poc,
                {
                    baseliveagentcontenturl: content url,
                    deploymentid: deploymentid,
                    buttonid: buttonid1,
                    baseliveagenturl: baseliveagenturl,
                    eswliveagentdevname: embeddedserviceliveagent_...,
                    isofflinesupportenabled: false
                }
            );
        };

        if (!window.embedded_svc) {
            var s = document.createelement(script);
            s.setattribute(src, mydomain.my.salesforce.com/embeddedservice/5.0/esw.min.js);
            s.onload = function() {
                initesw(null);
            };
            document.body.appendchild(s);
        } else {
            initesw(https://service.force.com);
        }
    </script>
    
</apex:page>

now - i put in the line embedded_svc.settings.fallbackrouting an array of button ids that i have  = [buttonid1,buttonid2];.
expected behavior:

*

*if button buttonid1 has an available agent, the button should be clickable to start a chat session.

*if button buttonid1 does not have an available agent - the chat mechanism should check if buttonid2 has an available agent and if yes - the button should be clickable to start a chat session.

problem:
the 2nd choice does not happen never, the button shows availability only for the buttonid1 and if it is not available, nothing happens.
questions:
am i implementing this wrong?
is this the expected behavior of embedded_svc.settings.fallbackrouting?
is there another way to get fallback routing?

a: well i am not sure if youre still looking for answer to that but i had to implement fallback routing and that too dynamically. so initially it checks the agent availability based on the button defined in embedded setting, thats a global button and all the agent must be added to the associated queue, so that even if a single agent is available then button is clickable. and then i am dynamically assigning values to fallback setting just before calling the start chat method, so that itll route to correct agent only.
aura pre-chat component helper.js : on click of start chat button
 var fallbackarray =userid_buttonid; //or buttonid1_buttonid2
    var message=fallbackarrayvalue#+fallbackarray;
    window.postmessage(message, *);

   //setting time out to delay the execution of code till fallback settings get applied
    window.settimeout(
          $a.getcallback( function() {
           cmp.find(prechatapi).startchat(prechatfields);
      }));

host javascript where all other embedded settings are defined: to read the values sent by prechat component and to assign it dynamically to fallback setting
window.addeventlistener(message, function(event) {
     if (!json.stringify(event.data).includes(fallbackarrayvalue)) {
           // not the expected message: reject message!
            return;
       }
       console.log(event.origin:+ event.origin + ***event.data: +json.stringify(event.data));
        var fallbackarray = json.stringify(event.data).split(#);
        
     //to remove extra quotes() from the end of string
        fallbackarray = fallbackarray[1].substring(0, fallbackarray[1].length - 1)

    //since fallback routing only accepts array, hence wrapping the string inside square bracket
        embedded_svc.settings.fallbackrouting = [fallbackarray]; 
            });


user
The given text has one hundred and forty-four "r"s.
assistant