Inserting url into iframe

Hi,
I am not very proficient with JavaScript. I do my best to make educated guesses, haha. I have a question. I wrote a SharePoint List Form code, asking Plumsail to insert the SharePoint ID as a param with a PowerApps link into an iframe. It's a 60-40, and it doesn't always load the script correctly. Is there a way for me to improve the loading efficiency of the code; insert the link into the iframe so that it always captures the ID or waits until the ID loads before it inserts the link?

fd.spRendered(function () {
 function setiFrameURL() {
        $("iframe").attr("src", "https://apps.powerapps.com/play/e/default-33a0f4d4-f8f3-481c-bdeb-9868b68e1596/a/41bdccc8-a0c1-4ec5-bbcb-d840ccbe9a22?tenantId=33a0f4d4-f8f3-481c-bdeb-9868b68e1596?ID=" + fd.field("ID").value);
    }
    setiFrameURL();
    
    $(fd.field("AS400_seated_time").$parent.$el).hide();
    $(fd.field("ID").$parent.$el).hide();

    function hidebox() {
        if (fd.field("OrientationLocation").value == "CDL Program") {
            $(".Box1").hide();
            $(".Box2").show();
            fd.toolbar.hidden = true;
           
        } else {
            $(".Box1").show();
            $(".Box2").hide();
            fd.toolbar.hidden = false;

            function naruto() {
                if (fd.field("TravelToTruck").value) {
                    fd.field("TruckLocation").required = true;
                    $(fd.field("TruckLocation").$parent.$el).show();
                } else {
                    fd.field("TruckLocation").required = false;
                    $(fd.field("TruckLocation").$parent.$el).hide();
                }
            }

            fd.field("TravelToTruck").$on("change", naruto);

            naruto();

            fd.field("AS400Seated")
                .ready()
                .then(function (field) {
                    if (field.value) {
                        field.disabled = true;
                    }

                    fd.toolbar.buttons[1].click = function () {
                        if (confirm("Closing Without Saving?")) {
                            fd.close();
                        }
                    };
                });
        }
    }

    hidebox();
});

Dear @IT.Joe,
If you just need current Item ID, you don't need the ID field, you can just use:

fd.itemId

That does speed it up a lot. Thank you :slight_smile: