# \[HomeyScript\] Find deprecated Flowcards before migrating to Homey Pro (Early 2023)

**URL:** <https://community.homey.app/t/homeyscript-find-deprecated-flowcards-before-migrating-to-homey-pro-early-2023/105140>\
**Category:** Questions & Help\
**Tags:** homeyscript, homey-pro-2023\
**Created:** [February 24, 2024, 3:57pm UTC](https://community.homey.app/t/homeyscript-find-deprecated-flowcards-before-migrating-to-homey-pro-early-2023/105140 "2024-02-24T15:57:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![j\_wak](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/j_wak/32/56668_2.png) [@j\_wak](https://community.homey.app/u/j_wak)\
**Post date:** [February 24, 2024, 3:57pm UTC](https://community.homey.app/t/homeyscript-find-deprecated-flowcards-before-migrating-to-homey-pro-early-2023/105140/1 "2024-02-24T15:57:39Z")

</div>

Hiya, I didn’t know where to put this, but I found this place to be most helpful so I thought I would add it to the mix.

I just got my HP2023 and am doing some maintenance to the old one to ensure a smooth migration.

I wanted to know which of my flows had some of the deprecated stuff, like NFC, LED-ring, and apps that will not be available on the new device.

I couldn’t find a check for that, so I wrote this bit of code and wanted to share it if anyone would like to use it. Copy/Paste it to HomeyScript and run it!

```auto
Homey.flow.getAdvancedFlows().then(flowsResponse => {
    const visitedCards = new Set(); // Keep track of visited cards to avoid duplicates
    const cardsArray = []; // Array to store card objects
    
    for (const itemId in flowsResponse) {
        const item = flowsResponse[itemId];
        const flowName = item.name; // Get the flow name
        const exportsData = item.cards;
        
        for (const cardId in exportsData){
            const card = exportsData[cardId];
            const cardItemsUri = card.ownerUri;
            const cardItemsType = card.type;
            const key = flowName + '-' + cardItemsUri + '-' + cardItemsType; // Combine flow name, URI, and type into a single string
            
            if ((cardItemsUri === "homey:manager:ledring" || cardItemsUri === "homey:app:homey.countdown" || cardItemsUri === "homey:manager:nfc") &&  
                !visitedCards.has(key)) {
                // Add card object to the cardsArray
                cardsArray.push({
                    flowName: flowName,
                    cardType: cardItemsType,
                    cardUri: cardItemsUri
                });
                visitedCards.add(key);
            }
        }
    }
    
    // Sort the cardsArray by URI
    cardsArray.sort((a, b) => {
        return a.cardUri.localeCompare(b.cardUri);
    });
    
    // Output the sorted cards
    cardsArray.forEach(card => {
        console.log("Flow: " + card.flowName + "\nType: " + card.cardType + "\nURI: " + card.cardUri + "\n\n");
    });
});

```

Have a nice weekend! 🙂

---

<div class="post-metadata">

**Author:** ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)\
**Post date:** [February 28, 2024, 6:03pm UTC](https://community.homey.app/t/homeyscript-find-deprecated-flowcards-before-migrating-to-homey-pro-early-2023/105140/2 "2024-02-28T18:03:12Z")

</div>

> [@j\_wak](#):
>
> Hiya, I didn’t know where to put this,

Hiya JW,  
I guess as it isn’t an App is is kind of Off-topic here,  
But I like the Script!

Thanks for Contributing and I think it deserves an own Topic!  
So therefore Moved, or better: Promoted to your Own Topic!
